{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "Test output modes what different notebooks give"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<ipykernel.zmqshell.ZMQInteractiveShell object at 0x1052dddf0>\n"
     ]
    },
    {
     "ename": "NameError",
     "evalue": "name 'type_of_exec' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[0;31mNameError\u001B[0m                                 Traceback (most recent call last)",
      "Input \u001B[0;32mIn [1]\u001B[0m, in \u001B[0;36m<module>\u001B[0;34m\u001B[0m\n\u001B[1;32m      1\u001B[0m \u001B[38;5;28;01mfrom\u001B[39;00m \u001B[38;5;21;01mtradingstrategy\u001B[39;00m\u001B[38;5;21;01m.\u001B[39;00m\u001B[38;5;21;01mutils\u001B[39;00m\u001B[38;5;21;01m.\u001B[39;00m\u001B[38;5;21;01mjupyter\u001B[39;00m \u001B[38;5;28;01mimport\u001B[39;00m get_notebook_execution_mode\n\u001B[0;32m----> 3\u001B[0m mode \u001B[38;5;241m=\u001B[39m \u001B[43mget_notebook_execution_mode\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m      4\u001B[0m \u001B[38;5;28mprint\u001B[39m(mode)\n",
      "File \u001B[0;32m~/code/ts/client/tradingstrategy/utils/jupyter.py:27\u001B[0m, in \u001B[0;36mget_notebook_execution_mode\u001B[0;34m()\u001B[0m\n\u001B[1;32m     25\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(ipython, TerminalInteractiveShell):\n\u001B[1;32m     26\u001B[0m     \u001B[38;5;28;01mreturn\u001B[39;00m JupyterOutputMode\u001B[38;5;241m.\u001B[39mterminal\n\u001B[0;32m---> 27\u001B[0m \u001B[38;5;28;01melif\u001B[39;00m \u001B[38;5;124m'\u001B[39m\u001B[38;5;124mzmqshell\u001B[39m\u001B[38;5;124m'\u001B[39m \u001B[38;5;129;01min\u001B[39;00m \u001B[43mtype_of_exec\u001B[49m:\n\u001B[1;32m     28\u001B[0m     \u001B[38;5;28;01mreturn\u001B[39;00m JupyterOutputMode\n\u001B[1;32m     30\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m JupyterOutputMode\u001B[38;5;241m.\u001B[39munknown\n",
      "\u001B[0;31mNameError\u001B[0m: name 'type_of_exec' is not defined"
     ]
    }
   ],
   "source": [
    "from tradingstrategy.utils.jupyter import get_notebook_execution_mode\n",
    "\n",
    "mode = get_notebook_execution_mode()\n",
    "print(mode)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}